// https://acm.hdu.edu.cn/showproblem.php?pid=2041

#include <iostream>
#include <vector>
using namespace std;

int dp[50];
void init() {
    dp[0] = 1;
    dp[1] = 1;
    for (int i=2; i <= 40; i++) {
        for (int j=1; j <= 2; j++) {
            dp[i] += dp[i-j];
        }
    }
}


int main() {
    int n, t;
    init();
    scanf("%d", &n);
    while (n--) {
        scanf("%d", &t);
        printf("%d\n", dp[t-1]);
    }

    return 0;
}